package com.lagou.util;


import java.io.Serializable;
public class ResponseData implements Serializable {

    private int code;
    private String msg;
    private Object data;

    public ResponseData() {
    }

    public ResponseData(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ResponseData(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }



    public static ResponseData fail(String msg){
        return new ResponseData(500,msg);
    }

    public static ResponseData success(String msg){
        return new ResponseData(200,msg);
    }

    public static ResponseData to302(String msg,Object object){
        return new ResponseData(302,msg,object);
    }

    public static ResponseData success(String msg,Object obj){
        return new ResponseData(200,msg,obj);
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
